﻿using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UPos.Core.Entity
{
    public class ShopInfo
    {
        public string Mallid { get; set; }

        public string Storecode { get; set; }

        public string Itemcode { get; set; }

        public string Username { get; set; }

        public string Password { get; set; }

        public string Licensekey { get; set; }

        public string ShopName { get; set; }

        public int ShopID { get; set; }

        public string ShopFID { get; set; }

        internal ShopInfo() { }

        internal ShopInfo(DbDataReader reader)
        {
            Mallid = reader.GetString(reader.GetOrdinal("mallid"));
            Storecode = reader.GetString(reader.GetOrdinal("storecode"));
            Itemcode = reader.GetString(reader.GetOrdinal("itemcode"));
            Username = reader.GetString(reader.GetOrdinal("username"));
            Password = reader.GetString(reader.GetOrdinal("password"));

            int index= reader.GetOrdinal("licensekey");
            if (!reader.IsDBNull(index))
                Licensekey = reader.GetString(index);

            ShopName = reader.GetString(reader.GetOrdinal("ShopName"));
            ShopID = reader.GetInt32(reader.GetOrdinal("ShopID"));
            ShopFID = reader.GetString(reader.GetOrdinal("ShopFID"));
        }
    }
}
